package com.neuron.entity;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * IntegrationLogsId entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "INTEGRATION_LOGS")
public class IntegrationLogs implements java.io.Serializable {
	private static final long serialVersionUID = 1L;
	private Long logId;
	private String fromHost;
	private String toHost;
	private String serviceId;
	private Date gmtCreate = new Date();
	private String inParam;
	private String outParam;
	private String fromSys;
	private String toSys;
	private int success;

	// Constructors
	@Column(name = "SUCCESS", precision = 1, scale = 0)
	public int getSuccess() {
		return success;
	}

	public void setSuccess(int success) {
		this.success = success;
	}

	/** default constructor */
	public IntegrationLogs() {
	}

	/** full constructor */
	public IntegrationLogs(Long logId, String fromHost, String toHost, String serviceId, Date gmtCreate, String inParam, String outParam, String fromSys,
			String toSys) {
		this.logId = logId;
		this.fromHost = fromHost;
		this.toHost = toHost;
		this.serviceId = serviceId;
		this.gmtCreate = gmtCreate;
		this.inParam = inParam;
		this.outParam = outParam;
		this.fromSys = fromSys;
		this.toSys = toSys;
	}

	// Property accessors
	@Id
	@Column(name = "LOG_ID", precision = 14, scale = 0)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SERVICE_ROUTER_SEQ")
	@SequenceGenerator(name = "SERVICE_ROUTER_SEQ", sequenceName = "SERVICE_ROUTER_SEQ")
	public Long getLogId() {
		return this.logId;
	}

	public void setLogId(Long logId) {
		this.logId = logId;
	}

	@Column(name = "FROM_HOST", length = 30)
	public String getFromHost() {
		return this.fromHost;
	}

	public void setFromHost(String fromHost) {
		this.fromHost = fromHost;
	}

	@Column(name = "TO_HOST", length = 30)
	public String getToHost() {
		return this.toHost;
	}

	public void setToHost(String toHost) {
		this.toHost = toHost;
	}

	@Column(name = "SERVICE_ID", length = 150)
	public String getServiceId() {
		return this.serviceId;
	}

	public void setServiceId(String serviceId) {
		this.serviceId = serviceId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "GMT_CREATE", length = 7)
	public Date getGmtCreate() {
		return this.gmtCreate;
	}

	public void setGmtCreate(Date gmtCreate) {
		this.gmtCreate = gmtCreate;
	}

	@Lob
	@Basic(fetch = FetchType.EAGER)
	@Column(name = "IN_PARAM", columnDefinition = "CLOB", nullable = true)
	public String getInParam() {
		return this.inParam;
	}

	public void setInParam(String inParam) {
		this.inParam = inParam;
	}

	@Lob
	@Basic(fetch = FetchType.EAGER)
	@Column(name = "OUT_PARAM", columnDefinition = "CLOB", nullable = true)
	public String getOutParam() {
		return this.outParam;
	}

	public void setOutParam(String outParam) {
		this.outParam = outParam;
	}

	@Column(name = "FROM_SYS", length = 30)
	public String getFromSys() {
		return this.fromSys;
	}

	public void setFromSys(String fromSys) {
		this.fromSys = fromSys;
	}

	@Column(name = "TO_SYS", length = 30)
	public String getToSys() {
		return this.toSys;
	}

	public void setToSys(String toSys) {
		this.toSys = toSys;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof IntegrationLogs))
			return false;
		IntegrationLogs castOther = (IntegrationLogs) other;

		return ((this.getLogId() == castOther.getLogId()) || (this.getLogId() != null && castOther.getLogId() != null && this.getLogId().equals(
				castOther.getLogId())))
				&& ((this.getFromHost() == castOther.getFromHost()) || (this.getFromHost() != null && castOther.getFromHost() != null && this.getFromHost()
						.equals(castOther.getFromHost())))
				&& ((this.getToHost() == castOther.getToHost()) || (this.getToHost() != null && castOther.getToHost() != null && this.getToHost().equals(
						castOther.getToHost())))
				&& ((this.getServiceId() == castOther.getServiceId()) || (this.getServiceId() != null && castOther.getServiceId() != null && this
						.getServiceId().equals(castOther.getServiceId())))
				&& ((this.getGmtCreate() == castOther.getGmtCreate()) || (this.getGmtCreate() != null && castOther.getGmtCreate() != null && this
						.getGmtCreate().equals(castOther.getGmtCreate())))
				&& ((this.getInParam() == castOther.getInParam()) || (this.getInParam() != null && castOther.getInParam() != null && this.getInParam().equals(
						castOther.getInParam())))
				&& ((this.getOutParam() == castOther.getOutParam()) || (this.getOutParam() != null && castOther.getOutParam() != null && this.getOutParam()
						.equals(castOther.getOutParam())))
				&& ((this.getFromSys() == castOther.getFromSys()) || (this.getFromSys() != null && castOther.getFromSys() != null && this.getFromSys().equals(
						castOther.getFromSys())))
				&& ((this.getToSys() == castOther.getToSys()) || (this.getToSys() != null && castOther.getToSys() != null && this.getToSys().equals(
						castOther.getToSys())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result + (getLogId() == null ? 0 : this.getLogId().hashCode());
		result = 37 * result + (getFromHost() == null ? 0 : this.getFromHost().hashCode());
		result = 37 * result + (getToHost() == null ? 0 : this.getToHost().hashCode());
		result = 37 * result + (getServiceId() == null ? 0 : this.getServiceId().hashCode());
		result = 37 * result + (getGmtCreate() == null ? 0 : this.getGmtCreate().hashCode());
		result = 37 * result + (getInParam() == null ? 0 : this.getInParam().hashCode());
		result = 37 * result + (getOutParam() == null ? 0 : this.getOutParam().hashCode());
		result = 37 * result + (getFromSys() == null ? 0 : this.getFromSys().hashCode());
		result = 37 * result + (getToSys() == null ? 0 : this.getToSys().hashCode());
		return result;
	}
}